from flask_apscheduler import APScheduler
from .setting import *
from .utils import *
from flask import Flask,redirect,render_template, request,json,jsonify,url_for,current_app,Blueprint
from .views import webapp

app = Flask(__name__)
def create_app():
    app.register_blueprint(webapp, url_prefix='/')
    scheduler = APScheduler()
    scheduler.init_app(app)
    scheduler.add_job(func=reloadtasks, trigger='interval', seconds=CHECK_INTERVAL, id=SCANKEY, args=(scheduler,))
    scheduler.start()
    return app

